using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class so_PrintRecordMap : EntityTypeConfiguration<so_PrintRecord>
    {
        public so_PrintRecordMap()
        {
            // Primary Key
            this.HasKey(t => new { t.FieldName, t.Value });

            // Properties
            this.Property(t => t.FieldName)
                .IsRequired()
                .HasMaxLength(48);

            this.Property(t => t.Value)
                .IsRequired()
                .HasMaxLength(102);

            // Table & Column Mappings
            this.ToTable("so_PrintRecord");
            this.Property(t => t.FieldName).HasColumnName("FieldName");
            this.Property(t => t.Value).HasColumnName("Value");
        }
    }
}
